<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>38 ES6 getter setter</title>
</head>

<body>
    <script>
        class Phone {
            get price() {
                console.log('read price prop');
                return 'I love you'
            }

            set price(newVal) {
                console.log('price modified');
            }
        }

        let s = new Phone();
        console.log(s.price);
        s.price = 'free';
    </script>
</body>

</html>